import service from '@/api/service'
import type { LoginRequest, LoginResponse } from '@/type/Auths'
import type { UserVo } from '@/type/User'

// 认证相关前缀
const mapping = 'auth'


/* 用户登录 */
export const loginApi = (param: LoginRequest) => service.post<LoginResponse>(`${mapping}/login`, param)

/* 用户退出登录 */
export const logoutApi = () => service.post<undefined>(`${mapping}/logout`)

/* 获取登录用户的详细信息 */
export const currentUserInfoApi = () => service.get<UserVo>(`user`)
